#include "SeqList.h"

void TestSeqList1()
{
    SL s1;
    SeqListInit(&s1);
    SeqListPushBack(&s1, 1);
    SeqListPushBack(&s1, 2);
    SeqListPushBack(&s1, 3);
    SeqListPushBack(&s1, 4);
    SeqListPushBack(&s1, 5);

    SeqListPrint(&s1);

    SeqListDestroy(&s1);
}

void TestSeqList2()
{

    SL s1;
    SeqListInit(&s1);
    SeqListPushBack(&s1, 1);
    SeqListPushBack(&s1, 2);
    SeqListPushBack(&s1, 3);
    SeqListPushBack(&s1, 4);
    SeqListPushBack(&s1, 5);
    SeqListPrint(&s1);
    SeqListPushFront(&s1, 10);
    SeqListPushFront(&s1, 20);
    SeqListPushFront(&s1, 30);
    SeqListPrint(&s1);
    SeqListDestroy(&s1);
}

void TestSeqList3()
{

    SL s1;
    SeqListInit(&s1);
    SeqListPushBack(&s1, 1);
    SeqListPushBack(&s1, 2);
    SeqListPushBack(&s1, 3);
    SeqListPushBack(&s1, 4);
    SeqListPushBack(&s1, 5);
    SeqListPrint(&s1);

    SeqListInsert(&s1, 0, -1);
    SeqListInsert(&s1, 5, 60);
    SeqListPrint(&s1);

    int pos = SeqListFind(&s1, 4);
    if (pos != -1)
    {
        SeqListInsert(&s1, pos, 40);
    }

    SeqListPrint(&s1);
    SeqListDestroy(&s1);
}

void TestSeqList4()
{

    SL s1;
    SeqListInit(&s1);
    SeqListPushBack(&s1, 1);
    SeqListPushBack(&s1, 2);
    SeqListPushBack(&s1, 3);
    SeqListPushBack(&s1, 4);
    SeqListPushBack(&s1, 5);
    SeqListPrint(&s1);


    SeqListErase(&s1, 2);
    SeqListPrint(&s1);

    SeqListDestroy(&s1);
}

int main()
{
    // TestSeqList1();
    // TestSeqList2();
    // TestSeqList3();
    TestSeqList4();
    return 0;
}